/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.att.config;

import com.android.ddmlib.AdbCommandRejectedException;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.ShellCommandUnresponsiveException;
import com.android.ddmlib.TimeoutException;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author lenovo
 */
public class ExcuteGetEventImplicit extends Thread{
    
    private OutputReceiver receiver;
    
    public ExcuteGetEventImplicit(OutputReceiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void run() {
        IDevice device = AndroidProxy.getInstance().getDevice();
        try {
            System.out.println("Thread started");
            try {
				device.executeShellCommand("getevent", receiver);
			} catch (TimeoutException e) {
				e.printStackTrace();
			} catch (AdbCommandRejectedException e) {
				e.printStackTrace();
			} catch (ShellCommandUnresponsiveException e) {
				e.printStackTrace();
			}
        } catch (IOException ex) {
            Logger.getLogger(ExcuteGetEventImplicit.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}
